<?php
global $base_dir;
$base_dir='../';

/**** 模块调用*****/
include_once($base_dir."inc/inc_connect.php");		//通用函数包含文件
include_once($base_dir."inc/ClassUpfile.php");		//图片上传类

include_once("index_inc.php");
include_once("func/function.php");
include_once($base_dir."inc/manage.php");			//后台通用包含文件
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>后台管理系统</title>
</head>
<body>
<?php
$t=new Tbl_Act($tbl_name,$tbl_key);		//创建表对象
if(is_array($_POST))
{
	foreach($_POST as $key => $value)
	{
		$t->$key=$value;
	}
	if($t->act=='')
	{
		$t->act=$_GET['act'];
	}
//上传图片 start

//上传图片 end
	$t->Tord_playdate=strtotime($t->Tord_playdate);		#游玩日期
	$t->Tord_price3=floatval($t->Tord_price3);
	$t->Tord_price4=floatval($t->Tord_price4);
	switch($t->act)
	{
		case 'save':	//添加
		
			if($t_num==0)
			{
				$t->Tord_createtime=time();
				if($insertid=$t->Insert())
				{
					echo '添加成功...';
					$url=$url_list;
				}
				else
				{
					echo '添加失败...';
					$url=$url_add;
				}
			}
			else
			{
				echo "添加失败,有重复数据";
				$url=$url_add;
			}
			break;
		case 'update':
			if($t_num==0)
			{
				if($t->Update())
				{
					echo '修改成功...';
					$url=$url_list;
				}
				else
				{
					echo '修改失败...';
					$url=$url_list;
				}
			}
			else
			{
				echo "修改失败,有重复数据";
				$url=$url_list;
			}
			break;
		case 'del':
			$t->$tbl_key=$_GET['id'];
			if($t->Del())
			{
				echo '删除成功...';
				$url=$url_list;
			}
			else
			{
				echo '删除失败...';
				$url=$url_list;
			}
		case 'modStu':
			$t=new Tbl_Act($tbl_name,$tbl_key);		//创建表对象
			$t->$tbl_key=$_GET['id'];
			$t->GetOne(array($tbl_key.',='));
			if($t->Tord_status!=$_GET['ost'] || empty($_GET['st']))
			{
				echo '操作失败，订单状态有变动...';
				$url=$url_list;	
			}
			else
			{
				$t->Tord_status=$_GET['st'];
				$rs=$t->Update();
				if($rs)
				{
					echo '操作成功';
				}
				else
				{
					echo '操作失败';
				}
				$url=$url_list;	
			}
			break;
		default:
			break;
	}
}
?>
<script language="javascript">
setTimeout("location.href='<?=$url?>?<?=QueryString('act,id')?>'",1500);
</script>
<!-- 7caihu.com Baidu tongji analytics -->
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");

document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fb8797ecb21d1ccb839c35b190277a0cd' type='text/javascript'%3E%3C/script%3E"));

</script>
</body>
</html>
<?php
include_once($base_dir."inc/inc_unconnect.php")
?>